package jvm;

import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;

public class JvmAppClassLoaderAddURL {
    public static void main(String[] args) throws Exception{
        URLClassLoader classLoader = (URLClassLoader) JvmAppClassLoaderAddURL.class.getClassLoader();
        Method addUrl = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
        addUrl.setAccessible(true);
        URL url = new URL("file:/D:\\MyProgramma\\IdeaProjects\\SpringbootCompilation\\GeekBangJava\\out\\production\\Week01");
        addUrl.invoke(classLoader,url);
        Class.forName("jvm.MyHello");
    }
}
